package com.extsci.monitor.factory;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author ccoke
 */
@Component
public class RabbitmqFactory {
    private final AmqpTemplate amqpTemplate;

    @Autowired
    public RabbitmqFactory(AmqpTemplate amqpTemplate) {
        this.amqpTemplate = amqpTemplate;
    }

    public void sendMessage(String exchange, String routingKey, Object message){
        amqpTemplate.convertAndSend(exchange, routingKey, message);
    }
}
